package com.luzhikun.xianLiva;

/**
 * @author shkstart
 * @create 2021-03-17 8:15
 */
public class PlayProduct extends Product {
    //玩家购买的货物的数量
    private int count;

    public PlayProduct(int count) {
        this.count = count;
    }

    public PlayProduct(Product product, int count) {
        super(product.getProId(), product.getName(), product.getMaxPrice(), product.getMinprice());
        this.setNowPrice(this.getNowPrice());
        this.count = count;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return super.toString() + "   " + count;
    }

    /*
     * 获取当前货物总价
     *
     * */
    public int getAllPrice() {
        int proPrices = this.count * this.getNowPrice();

        return proPrices;
    }

}
